
insert into c_prospecto
select	*
from	(select * from openquery(ARGENTADB, 'select c_prospecto.* from c_prospecto inner join parametros on fecha_alta > fecha_ultima_migracion where fecha_alta is not null')) c_prospecto
go

insert into c_prospecto_desarrollo
select	*
from	(select * from openquery(ARGENTADB, 'select c_prospecto_desarrollo.* from c_prospecto_desarrollo inner join parametros on fecha_alta > fecha_ultima_migracion where fecha_alta is not null')) c_prospecto_desarrollo
go

insert into c_cotizacion
select	*
from	(select * from openquery(ARGENTADB, 'select c_cotizacion.* from c_cotizacion inner join parametros on fecha_alta > fecha_ultima_migracion where fecha_alta is not null')) c_cotizacion
go

insert into c_bloqueo
select	*
from	(select * from openquery(ARGENTADB, 'select c_bloqueo.* from c_bloqueo inner join parametros on fecha_alta > fecha_ultima_migracion where fecha_alta is not null')) c_bloqueo
go

insert into c_prosp_contr
select	*
from	(select * from openquery(ARGENTADB, 'select c_prosp_contr.* from c_prosp_contr inner join parametros on fecha_alta > fecha_ultima_migracion where fecha_alta is not null')) c_prosp_contr
go

update openquery(ARGENTADB, 'select fecha_ultima_migracion, now() as currenctdate from parametros')
set fecha_ultima_migracion = currenctdate
go
